This repository was archived by the owner on May 31, 2022. It is now read-only.
WIP [do not review]: Simplify connecting, fix double authSource#348
Open
WIP [do not review]: Simplify connecting, fix double authSource#348
Conversation
Anemy
commented
Feb 9, 2021
| : undefined; | ||
| } catch (e) { | ||
| /* eslint no-console: 0 */ | ||
| console.log('Could not load electron', e.message); |
Member
Author
There was a problem hiding this comment.
This would sometimes show up in vscode, here we make it less noisy.
Anemy
commented
Feb 9, 2021
| const debug = require('debug')('mongodb-connection-model:connect'); | ||
|
|
||
| const needToLoadSSLFiles = (model) => | ||
| !includes(['NONE', 'UNVALIDATED'], model.sslType); |
Member
Author
There was a problem hiding this comment.
sslType doesn't seem to exist on connection-model, so this false condition would never occur. Probably a bug, removed it and updated how we load the ssl files into buffers.
Anemy
commented
Feb 9, 2021
| if (includes(['LDAP', 'KERBEROS', 'X509'], this.authStrategy)) { | ||
| if ( | ||
| includes(['LDAP', 'KERBEROS', 'X509'], this.authStrategy) | ||
| && !url.includes('authSource=') |
Member
Author
There was a problem hiding this comment.
this would sometimes apply authSource=$external twice to connection strings. Maybe a bug? Some of the tests had test cases with the duplicate authSource=$external. Not sure if intentional. I think it would probably be better to be using the url package for managing this url and not doing straight string editing. not going to get into that in this pr I think.
This was referenced Feb 9, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR does some refactoring of connect so it uses async/await (see data-service and compass-connect PRs). Removed some unused code. Updated tests and improved them a bit.
Originally I was looking into fixing how we load ssl files into buffers so that we just pass the files into buffers. It ended up having some more nuances with the driver than I expected so I'm opening this PR first, without any large ssl changes, and I'm thinking we can address it separately in COMPASS-4615 . In 4.0.0 the driver also drops support for buffers, and hopefully it's doing a little less behind the scenes there.